import request from '@/utils/request'
import { encryptionData } from '@/utils/com'
import Qs from 'qs'
/* 获取分账接收者详情信息 */
export function jcdUserAccountReceiverget(data) {
  return request({
    url: `/jcdPayment/jcdUserAccountReceiver/get/${data.id}`,
    method: 'GET',
    headers: encryptionData(data, `/jcdUserAccountReceiver/get/${data.id}`),
  })
}
//  认证详情
export function brandMerchantAuthGetInfo(data) {
  return request({
    url: `/jcd-gys/brandMerchantAuth/getInfo`,
    method: 'GET',
    params: data,
    headers: encryptionData(data, `/jcd-gys/brandMerchantAuth/getInfo`),
  })
}
//  开户详情
export function tlPaymentAccountGetInfo(data) {
  return request({
    url: `/jcd-payment/tlPaymentAccount/getInfo`,
    method: 'GET',
    params: data,
    headers: encryptionData(data, `/jcd-gys/brandMerchantAuth/getInfo`),
  })
}
/* 分账接受者信息-修改 */
export function updateSeparateAccountsReceiver(data) {
  return request({
    url: `/jcdPayment/jcdUserAccountReceiver/updateSeparateAccountsReceiver`,
    method: 'put',
    headers: encryptionData(data, '/jcdUserAccountReceiver/updateSeparateAccountsReceiver'),
    data: Qs.stringify(data)
  })
}
/* 分账接受者信息-修改 失败时*/
export function jcdUserAccountReceiveredit(data) {
  return request({
    url: `/jcdPayment/jcdUserAccountReceiver/edit`,
    method: 'put',
    headers: encryptionData(data, '/jcdPayment/jcdUserAccountReceiver/edit'),
    data: Qs.stringify(data)
  })
}
/* 新增新增分账接受者信息 */
export function addSeparateAccountsReceiver(data) {
  return request({
    url: '/jcdPayment/jcdUserAccountReceiver/addSeparateAccountsReceiver',
    method: 'post',
    headers: encryptionData(data, '/jcdUserAccountReceiver/addSeparateAccountsReceiver'),
    data: Qs.stringify(data)
  })
}
/* 接受方信息-删除 */
export function deletejcdUserAccountReceiver(data) {
  return request({
    url: `/jcdPayment/jcdUserAccountReceiver/delete`,
    method: 'DELETE',
    headers: encryptionData(data, `/jcdUserAccountReceiver/delete`),
    data: Qs.stringify(data)
  })
}
/* 分账接受方信息 */
export function jcdUserAccountReceiver(data) {
  return request({
    url: `/jcdPayment/jcdUserAccountReceiver/page`,
    method: 'get',
    headers: encryptionData(data, '/jcdUserAccountReceiver/page'),
    params: data
  })
}
/* 查询商户号是否有 */
export function getUser(data) {
  return request({
    url: `/jcdSys/user/getUser/${data.id}`,
    method: 'get',
    headers: encryptionData(data, '/user/getUser')
  })
}
/* 设置商户号 */
export function updateUser(data) {
  return request({
    url: '/jcdSys/user/updateUser',
    method: 'put',
    headers: encryptionData(data, '/user/updateUser'),
    data: Qs.stringify(data)
  })
}
/* 生成产品标签 */
export function exportProductLabelBatch(data) {
  return request({
    url: '/jcdGys/materials/exportProductLabelBatch',
    method: 'get',
    headers: encryptionData(data, '/materials/exportProductLabelBatch'),
    params: data
  })
}
/* 取消生成标签 */
export function cancelExportLabel(data) {
  return request({
    url: '/jcdGys/materials/cancelExportLabel',
    method: 'get',
    headers: encryptionData(data, '/materials/cancelExportLabel'),
  })
}
/* 生成二维码 */
export function getQrCode(data) {
  return request({
    url: '/jcdGys/materials/getQrCode',
    method: 'get',
    headers: encryptionData(data, '/materials/getQrCode'),
    params: data
  })
}
/* 获取品牌商信息列表 */
export function getDealerList(data) {
  return request({
    url: '/jcdGys/merchant/findPage',
    method: 'get',
    headers: encryptionData(data, '/merchant/findPage'),
    params: data
  })
}

/* 品牌商信息-删除 */
export function deleteDealer(data) {
  return request({
    url: '/jcdGys/merchant/delByIds',
    method: 'post',
    headers: encryptionData(data, '/merchant/delByIds'),
    data: Qs.stringify(data)
  })
}

/* 品牌商信息-获取公司信息详情 */
export function getDealerDetail(data) {
  return request({
    url: `/jcdGys/merchant/get/${data.id}`,
    method: 'get',
    headers: encryptionData(data, `/merchant/get/${data.id}`),
    params: data
  })
}

/* 品牌商信息-修改 */
export function updDealerDetail(data) {
  return request({
    url: `/jcdGys/merchant/update`,
    method: 'put',
    headers: encryptionData(data, '/merchant/update'),
    data: Qs.stringify(data)
  })
}

/* 品牌商信息-审核 */
export function auditDealer(data) {
  return request({
    url: `/jcdGys/merchant/checkInfo`,
    method: 'put',
    headers: encryptionData(data, '/merchant/checkInfo'),
    data: Qs.stringify(data)
  })
}

/* 品牌商信息-重置密码 */
export function resetDealerPsd(data) {
  return request({
    url: '/jcdGys/merchant/resetMerchantPwd',
    method: 'post',
    headers: encryptionData(data, '/merchant/resetMerchantPwd'),
    data: Qs.stringify(data)
  })
}

/* 品牌商信息-托管-列表 */
export function getSetTg(data) {
  return request({
    url: '/jcdGys/merchant/selectTgUser',
    method: 'get',
    headers: encryptionData(data, `/merchant/get/${data.id}`),
    params: data
  })
}

// brand-list
/* 获取品牌信息列表 */
export function getBrandList(data) {
  return request({
    url: '/jcdGys/merchantBrand/findPage',
    method: 'get',
    headers: encryptionData(data, '/merchantBrand/findPage'),
    params: data
  })
}

/* 品牌信息-获取品牌详情 */
export function getBrandDetail(data) {
  return request({
    url: `/jcdGys/merchantBrand/get/${data.id}`,
    method: 'get',
    headers: encryptionData(data, `/merchantBrand/get/${data.id}`),
    params: data
  })
}

/* 品牌信息-修改 */
export function updBrand(data) {
  return request({
    url: '/jcdGys/merchantBrand/update',
    method: 'put',
    headers: encryptionData(data, '/merchantBrand/update'),
    data: Qs.stringify(data)
  })
}

// product-list

/* 获取产品管理列表 */
export function getProductList(data) {
  return request({
    url: '/jcdGys/materials/pageMaterials',
    method: 'get',
    headers: encryptionData(data, '/materials/pageMaterials'),
    params: data
  })
}

/* 产品管理-删除 */
export function deleteProduct(data) {
  return request({
    url: `/jcdGys/materials/byBatch/${data.ids}`,
    method: 'DELETE',
    headers: encryptionData(data, `/materials/byBatch/${data.ids}`),
    data: Qs.stringify(data)
  })
}

/* 产品管理-修改 */
export function updProduct(data) {
  return request({
    url: '/jcdGys/materials/updInfo',
    method: 'PUT',
    headers: encryptionData(data, '/materials/updInfo'),
    data: Qs.stringify(data)
  })
}

/* 产品管理-审核 */
export function auditProduct(data) {
  return request({
    url: '/jcdGys/materials/checkInfo',
    method: 'PUT',
    headers: encryptionData(data, '/materials/checkInfo'),
    data: Qs.stringify(data)
  })
}

/* 确认订单 */
export function affirmOrder(data) {
  return request({
    url: '/jcdOrder/purchaseOrder/confirmOrder',
    method: 'post',
    headers: encryptionData(data, '/purchaseOrder/confirmOrder'),
    data: Qs.stringify(data)
  })
}

/* 获取sku列表 */
export function getSkuList(data) {
  return request({
    url: '/jcdGys/jcdMaterialsSku/getList',
    method: 'get',
    headers: encryptionData(data, '/jcdMaterialsSku/getList'),
    params: data
  })
}
